round

 

round reports the integer to the nearest whole number. Numbers in NetLogo are always rounded in the positive direction. For example: show round 4.5 => 5 show round -4.5 => -4

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the round primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Similar primitives:
count

Count the number of agents in an agentset.

Read more
floor

Round a number down to the nearest integer.

Read more
ceiling

Round a number up to the nearest integer.

Read more
mean

Find the mean of a list of values.

Read more
 
Learn another primitive